﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AuditionEdit.aspx.cs" Inherits="Web.AuditionEdit" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <base target="_self" />
    <meta content="ie=7" http-equiv="x-ua-compatible">
    <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
    <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
    <META HTTP-EQUIV="Expires" CONTENT="0">
    <link href="Styles/Style01.css" rel="stylesheet" type="text/css" />
    <script src="Scripts/jquery-1.7.min.js" type="text/javascript"></script>
    <link href="Styles/validate.css" rel="stylesheet" type="text/css" />
    <script src="Scripts/easy_validator.pack.js" type="text/javascript"></script>
    <link href="Scripts/jquery.autocomplete.css" rel="stylesheet" type="text/css" />
    <script src="Scripts/jquery.autocomplete.js" type="text/javascript"></script>
    <script>
        //iframe高度自适应
        function IFrameReSize(iframename) {
            var pTar = document.getElementById(iframename);
            if (pTar) {  //ff
                if (pTar.contentDocument && pTar.contentDocument.body.offsetHeight) {
                    pTar.height = pTar.contentDocument.body.offsetHeight;
                } //ie
                else if (pTar.Document && pTar.Document.body.scrollHeight) {
                    pTar.height = pTar.Document.body.scrollHeight;
                }
            }
        }
        //iframe宽度自适应
        function IFrameReSizeWidth(iframename) {
            var pTar = document.getElementById(iframename);
            if (pTar) {  //ff
                if (pTar.contentDocument && pTar.contentDocument.body.offsetWidth) {
                    pTar.width = pTar.contentDocument.body.offsetWidth;
                }  //ie
                else if (pTar.Document && pTar.Document.body.scrollWidth) {
                    pTar.width = pTar.Document.body.scrollWidth;
                }
            }
        }

        //取get参数
        function getArg() {
            var url = unescape(window.location.href);
            var allArgs = url.split("?")[1];
            if (allArgs != null) {
                var args = allArgs.split("&");
                for (var i = 0; i < args.length; i++) {
                    var arg = args[i].split("=");
                    eval('this.' + arg[0] + '="' + arg[1] + '";');
                }
            }
        }
        var urlArg = new getArg();
        var pId = urlArg.id;

        $(function () {
            $("[reg]").parents("td").prev().append("<font color='#ff0000'>*</font>");
            $("#btnSave").click(function () {
                var isSubmit = true;
                $("form").find("[reg],[url]:not([reg])").each(function () {
                    if (!validate($(this), this.tagName)) {
                        isSubmit = false;
                    }
                });
                if (!isSubmit) {
                    alert("请确认'红字或红框'处的输入正确!");
                    return false;
                }
                return true;
            });
            var datas = ["前程无忧", "智联招聘", "卓博人才网", "内部推荐", "其他"];
            $("#InfoOrigin").autocomplete(datas, { minChars: 0 });
        });
        function subEdit(id) {
            var url = 'AuditionSubEdit.aspx?pId=' + pId;
            if (id != undefined) {
                url = 'AuditionSubEdit.aspx?id=' + id;
            }
            var retVal = window.showModalDialog(url, window, 'dialogWidth=550px;dialogHeight=550px;status=no;help=no;resizable=yes;');
            if (retVal != undefined && retVal.indexOf('Succeed') >= 0) {
                window.name = "__self";
                window.open(window.location.href, "__self");
            }
        }
        function subDel(id) {
            if (confirm('您确定删除该行记录吗?')) {
                $.ajax({ type: 'post', url: "/Audition.mvc/DelDetail", data: { id: id },
                    success: function (data, textStatus) {
                        if (data == "Succeed") {
                            window.name = "__self";
                            window.open(window.location.href, "__self");
                        }
                    }
                });
            }
        }
    </script>
</head>
<body>
<form id="Form1" runat=server>
<table class="s1">
<tr><td>姓名</td><td><input id="Name" runat="server" title="不能为空" reg="."></td>
<td>现住址</td><td><input id="Address" runat="server" title="不能为空" reg="."></td></tr>
<tr><td>应聘部门</td><td><select id="Dept" runat="server" title="请选择部门" reg="."></select></td>
<td>应聘职位</td><td><input id="Position" runat="server" title="不能为空" reg="."></td></tr>
<tr><td>手机</td><td><input id="Phone" runat="server" title="不能为空" reg="."></td>
<td>邮箱</td><td><input id="EMail" runat="server" title="不能为空" reg="."></td></tr>
<tr><td>信息来源</td><td><input id="InfoOrigin" runat="server" title="不能为空" reg="."></td>
<td>招聘类别</td><td><select id="AuditionType" runat="server" title="请选择招聘类别" reg=".">
<option value="社会招聘">社会招聘</option>
<option value="校园招聘">校园招聘</option>
<option value="内部推荐">内部推荐</option>
</select></td></tr>
<tr><td>备注</td><td colspan=3><input id="Remarks" runat="server"></td></tr>
</table>
<asp:Repeater ID="rptList" EnableViewState="False" Runat="server">
	<HeaderTemplate>
		<table class="s1 list">
			<caption>面试计划<input type=button onclick="javascript:subEdit();" value="添加明细"/></caption>
			<thead>
				<TR>
					<th width="15%">面试人</th>
					<th width="20%">面试时间</th>
					<th width="10%">面试结果</th>
					<th width="20%">备注</th>
					<th class="tdOrder">操作</th>
				</TR>
			</thead><tbody>
	</HeaderTemplate>
	<ItemTemplate>
		<tr class="<%# Container.ItemIndex%2==0?"bg":""%>">
			<td><%# DataBinder.Eval(Container.DataItem, "Interviewer")%></td>
			<td><%# DataBinder.Eval(Container.DataItem, "InterviewTime", "{0:f}")%></td>
			<td><%# DataBinder.Eval(Container.DataItem, "Result")%></td>
			<td><%# DataBinder.Eval(Container.DataItem, "Remarks")%></td>
			<td>
                <a href="#" onclick="subEdit(<%# DataBinder.Eval(Container.DataItem,"Id") %>);return false;">[编辑]</a>
                <a href="#" onclick="subDel(<%# DataBinder.Eval(Container.DataItem,"Id") %>);return false;">[删除]</a>
			</td>
		</tr>
	</ItemTemplate>
	<FooterTemplate>
		</tbody> </table>
	</FooterTemplate>
</asp:Repeater>
<div style="text-align:right;margin-right:24px;margin-top:6px;">
    <asp:button runat="server" class=btn text="保存" id="btnSave" onclick="btnSave_Click"/>
    <input type=button class=btn value="关闭" onclick="window.close();" />
</div>
</form>
</body>
</html>